#include <stdio.h>

typedef struct
{
    int year;
    int month;
    int day;
} Date;

int main(int argc, char *argv[])
{

    int i = 0;
    Date dates[100], temp;
    while (scanf("%d/%d/%d", &dates[i].month, &dates[i].day, &dates[i].year) != EOF)
    {
        i++;
    }

    for (size_t z = 0; z < i; z++)
    {
        for (size_t k = z + 1; k < i; k++)
        {
            if ((dates[z].year > dates[k].year) || (dates[z].year == dates[k].year && dates[z].month > dates[k].month) || (dates[z].year == dates[k].year && dates[z].month == dates[k].month && dates[z].day > dates[k].day))
            {
                temp = dates[z];
                dates[z] = dates[k];
                dates[k] = temp;
            }
        }
    }

    for (size_t z = 0; z < i; z++)
    {
        printf("%02d/%02d/%d\n", dates[z].month, dates[z].day, dates[z].year);
    }

    return 0;
}